<template>
  <div class="vendor_box" v-loading="signalsRadio1.loading" element-loading-text="加载中...">
    <div style="min-height: 200px" v-if="signalsRadio1.total > 0">
      <div class="forecast" v-if="signalsRadio1.title.title != ''">
        <div>
          相关的代理机构<span class="behalf_size">{{
    signalsRadio1.totals
  }}</span>家
        </div>
        <div class="forecast_ck"></div>
      </div>
      <div class="vendor" v-for="item in signalsRadio1.agencyLiss">
        <div>
          <!-- <img width="60px" src="@/assets/img/gys.png" alt="" /> -->
          <img width="60px" src="../../../../assets/newimg/gys.png" alt="" />
        </div>
        <div style="flex: 1; margin-left: 10px">
          <div class="vendor_cen">
            <div class="vendor_h" @click="gysClick(item.key)">
              <span v-html="item.key"></span>
            </div>
            <div>
              <span class="behalf">最近代理 {{ timestamp(item.max_time?.value) }}</span><span class="behalf">累计代理{{
    item.doc_count }}次</span><span class="behalf">代理总金额{{ money(item.color_sum_price?.value) }}</span>
            </div>
          </div>
          <div class="omission">
            <span style="color: #a9b1be; margin-right: 15px">最新代理</span>
            <span v-for="ele in item.field1Values.buckets" :key="ele">
              {{ ele.key }},</span>
          </div>
        </div>
      </div>
    </div>
    <Pagination ref="pagination" />
  </div>
  <div v-if="signalsRadio1.agencyLiss.length == 0" style="background-color: white; margin: 15px 0">
    <el-empty description="暂无数据" />
  </div>
</template>

<script setup>
import { timestamp, money } from "@/utils/index";
import Pagination from "@/components/pagination/index.vue";
import { useRadio1Store } from "@/pain/search/search";
import { useCounterStore } from "@/pain/login/login";
const signalsRadio1 = useRadio1Store();
const useRouters = useCounterStore();
// const pagination = ref(null);
// pagination.value.currentPage
// pagination.value.pageSize


import { useRouter } from "vue-router";
const router = useRouter();
const gysClick = (data) => {
  if (!localStorage.getItem("token")) {
    return useRouters.uselogin = true
  }
  const href = router.resolve({
    path: "/disposition",
    query: {
      id: signalsRadio1.id,
      name: data,
    },
  });
  window.open(href.href, "_blank");
};
</script>

<style lang="scss" scoped>
.behalf {
  height: 20px;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: #fe8d03;
  color: #fff;
  margin-left: 10px;
  font-size: 12px;
}

.behalf_size {
  padding: 0 5px;
  font-size: 18px;
  font-weight: 800;
}

.vendor_box {
  background-color: #fff;

  //
  .forecast {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
    border-bottom: 1px solid #eeeeee;
    // .forecast_ck{
    //     height: 30px;
    //     padding: 3px 10px;
    //     background-color: #5473DA;
    //     border-radius: 4px;
    //     color: #fff;
    // }
  }

  .vendor {
    display: flex;
    padding: 20px;
    border-bottom: 1px solid #eeeeee;
    cursor: pointer;

    &:hover {
      background-color: #eeeeee;
    }
  }

  .vendor_cen {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;

    

    .vendor_h {
      width: 272px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      margin-top: 5px;
      font-size: 16px;
      color: #333333;
    }
  }

  .omission {
    width: 1090px;
    text-align: left;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 14px;
  }
}
</style>
